package com.su.middle.services;



public class ProposalsImpl {

	public static int createProposal(Proposals proposal) throws Exception {
		ProposalServicesServiceLocator newWSDLFileServiceLocator = new ProposalServicesServiceLocator();
		try {			
			return newWSDLFileServiceLocator.getProposalServicesPort().createProposal(proposal);
		} catch (Exception e) {
			throw new Exception();
		}
	}
	
	public static void updateProposal(int proposalId, String newStatus) throws Exception {
		ProposalServicesServiceLocator newWSDLFileServiceLocator = new ProposalServicesServiceLocator();
		try {			
			newWSDLFileServiceLocator.getProposalServicesPort().updateProposal(proposalId, newStatus);
		} catch (Exception e) {
			throw new Exception();
		}
	}
	
	public static Proposals[] getStudentProposals(String studentName) throws Exception {
		ProposalServicesServiceLocator newWSDLFileServiceLocator = new ProposalServicesServiceLocator();
		try {			
			return newWSDLFileServiceLocator.getProposalServicesPort().getStudentProposals(studentName);
		} catch (Exception e) {
			throw new Exception();
		}
	}
}
